package com.itheima.exam;

import java.io.*;
import java.net.Socket;

public class Cliet {
    public static void main(String[] args) throws IOException {
        Socket socket=new Socket("192.168.11.40",10000);
        BufferedInputStream bis=new BufferedInputStream(new FileInputStream("exam\\img\\1.jpg"));
        BufferedOutputStream bos=new BufferedOutputStream(socket.getOutputStream());
        int  by;
        while ((by=bis.read())!=-1){
            bos.write(by);
        }
        bos.flush();
        socket.shutdownOutput();

        BufferedReader br=new BufferedReader(new InputStreamReader(socket.getInputStream()));
        String line;
        while ((line=br.readLine())!=null){
            System.out.println(line);
        }
        br.close();
        bis.close();
        socket.close();
    }
}
